# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=ncmpc
pkgver=0.47
pkgrel=0
pkgdesc="Ncurses client for the Music Player Daemon (MPD)"
url="https://www.musicpd.org/clients/ncmpc"
arch="all"
license="GPL-2.0-or-later"
makedepends="glib-dev libmpdclient-dev meson ncurses-dev py3-sphinx
	lirc-dev pcre2-dev"
subpackages="$pkgname-doc $pkgname-lang $pkgname-dbg"
source="https://www.musicpd.org/download/ncmpc/0/ncmpc-$pkgver.tar.xz"

build() {
	LDFLAGS="$LDFLAGS -lintl" \
	abuild-meson \
		-Dlirc=enabled \
		-Dcurses=ncurses \
		-Dlyrics_screen=true \
		-Dlyrics_plugin_dir=share/$pkgname/lyrics \
		-Dhtml_manual=false \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	mkdir -p "$pkgdir"/usr/share/$pkgname/lyrics
	install -m755 lyrics/* \
		"$pkgdir"/usr/share/$pkgname/lyrics
}

sha512sums="
6c9990ca9a0781eef67fae8b20ceec5fc00177b1db2b08cfdf122dd1f61f87a92030baadcaac154d73ddee622c963481d4e37d46f76a4ef21e51d4f18a6f3e6a  ncmpc-0.47.tar.xz
"
